package com.sakura.probe.pojo;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author Sakura
 * @since 2020-08-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("pb_topic_comment")
@ApiModel(value="Comment对象", description="话题评论")
public class Comment implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "评论的id")
    @TableId(value = "topic_comment_id", type = IdType.AUTO)
    private Long topicCommentId;

    @ApiModelProperty(value = "对应的帖子")
    private Long topicId;

    @ApiModelProperty(value = "评论人的id")
    private Long topicReviewerId;

    @ApiModelProperty(value = "评论某个评论(不是帖子)")
    @TableField(value = "topic_parent_id")
    private Long parentId;

    @ApiModelProperty(value = "评论的内容")
    private String content;

    @ApiModelProperty(value = "该条评论的状态(0-点灭，1-正常)")
    private Integer status;

    @ApiModelProperty(value = "评论的时间")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date lastEditTime;

    @ApiModelProperty(value = "该评论的回复数")
    @TableField(exist = false)
    private Long commentNum;

    @ApiModelProperty(value = "评论人的信息")
    @TableField(exist = false)
    private PersonInfo personInfo;

    @ApiModelProperty(value = "评论列表")
    @TableField(exist = false)
    private List<Comment> commentList;


    public Comment(){

    }

    public Comment(Long topicId, Long userId, Long parentId, String content) {
        this.topicId = topicId;
        this.topicReviewerId = userId;
        this.parentId = parentId;
        this.content = content;
    }
}
